package com.github.abel533;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

//@Import(TestImportAware.class)
@SpringBootApplication
public class DemoApplication /*extends SpringBootServletInitializer*/ {

    public static void main(String[] args) {
        ConfigurableApplicationContext context =
            new SpringApplicationBuilder(DemoApplication.class).registerShutdownHook(true).build().run(args);
        context.close();
        //SpringApplication.run(DemoApplication.class, args);

    }

    @Component
    @RestController
    public class DemoController {
        @RequestMapping
        public String hello() {
            return "Hello " + new Date();
        }
    }

}

